﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using UnityEngine;

namespace Assets.Game.scripts.components {

    [AddComponentMenu("NGUI/Interaction/Drag And Drop Item With Events")]
    public class UIDragDropItemListener : UIDragDropItem {

        public List<EventDelegate> onDragStart = new List<EventDelegate>();
        public List<EventDelegate> onDragEnd = new List<EventDelegate>();

        protected override void OnDragDropStart() {
            EventDelegate.Execute(this.onDragStart);
            base.OnDragDropStart();
        }

        protected override void OnDragDropMove(Vector2 delta) {
            base.OnDragDropMove(delta);
        }

        protected override void OnDragDropRelease(GameObject surface) {
            base.OnDragDropRelease(surface);
        }

        protected override void OnDragDropEnd (){
            base.OnDragDropEnd();
            EventDelegate.Execute(this.onDragEnd);
        }
    }
}
